<template>
	<view class="u-demo-block__content" style="width:90%;200rpx;margin: 0 5%;">
		<view class="div1">
			<view>
				<span class="span1">姓名:{{details.name}}</span>
				<span class="span1">性别:{{details.sex}}</span>
				<span class="span1">年龄:{{details.age}}</span>
			</view>
			<view>接诊时间: {{details.diagnosticTime}}</view>
			<view>
				<span class="span1">开单科室:{{details.divisionName}}</span>
				<span class="">开单医生:{{details.doctorName}}</span>
			</view>
		</view>
		<view class="div2" v-html="details.symptoms">
			
		</view>
	</view>

</template>

<script>
	import {msg} from '@/utils/utils.js'
	import request from '@/utils/requestConfig.js'
	//import $ from 'jquery'
	export default{
		data(){
			return{
				id:0,
				details:{
					name:'',
					sex:'',
					doctorName:'',
					divisionName:'',
					diagnosticTime:'',
					diagnosis:'',
					birthday:'',
					age:'',
					symptoms:'',
				}
			}
		},
		created(){
			this.id=uni.getStorageSync("id")
			this.getMedicalRecordsDetails(this.id)
		},
		methods:{

			/* 获取病历详情 */
			getMedicalRecordsDetails(id){
				request.post('/other/other/medical-records/getMedicalRecordsDetails',{id:id},false).then((res)=>{
					console.log(res)
					this.details=res.data.medicalRecordsDetails;
					let birthday=new Date(res.data.medicalRecordsDetails.birthday)
					this.details.age=new Date().getFullYear()-birthday.getFullYear()
					uni.hideLoading();
				}).catch(error=>{
					console.error(error)
				})
			}

		}
	}
</script>

<style scoped>
.div1{
	margin-top:30rpx ;
	border-radius: 30rpx;
	background-color: #E4E7ED;
	padding: 30rpx;
}
.span1{
	margin-right:55rpx ;
}
.div1 view{
	margin: 20rpx;
}
</style>
